package main
import (
	"fmt"
	"time"
	"runtime"
)

func main() {
	a :=make(chan int)
	b:=make(chan bool)
	go func() {
		for{
			select {
			case v:= <- a:
				fmt.Println(v)
			case <- time.After(5* time.Second):
				fmt.Println("time out")
				b<-true
				break
			}
		}
	}()
	a<- 0
	a<- 2
	a<- 3
	<- b

	fmt.Println(runtime.NumCPU())
	fmt.Println(runtime.GOMAXPROCS(5))
}
